<template>
	<view>
		<view class="uni-padding-wrap">
			<view class="page-section swiper">
				<view class="page-section-spacing">
					<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
						<swiper-item v-for="(item, index) in background"><image :src="item" class="image-index"></image></swiper-item>
					</swiper>
				</view>
			</view>
		</view>
		<view class="contents">
			<notice :notice="notice"></notice>
			<iconbutton :List="iconbuttonList"></iconbutton>
		</view>
	</view>
</template>
<script>
import notice from '@/components/notice';
import iconbutton from '@/components/iconbutton';
export default {
	components: { notice, iconbutton },
	data() {
		return {
			background: ['/static/a.jpg', '/static/b.png', '/static/c.jpg'],
			notice: {
				Info: { url: '/pages/notice/details' },
				list: [{ name: '我是公告一', key: { guid: '1', id: 1 } }, { name: '我是公告二', key: { guid: '2', id: 2 } }]
			},
			iconbuttonList: [
				{
					key: 'd',
					name: '待处理',
					list: [
						{ iconPath: '/static/d0.png', iconName: '审批', url: '/pages/home/index'},
						{ iconPath: '/static/d1.png', iconName: '工单', url: '2' },
						{ iconPath: '/static/d2.png', iconName: '巡检', url: '' },
						{ iconPath: '/static/d3.png', iconName: '异常', url: '' },
						{ iconPath: '/static/d4.png', iconName: '保养', url: '' }
					],
					code: { iconPath: '/static/saoyisao.gif', iconName: '二维码', url: '/pages/project/index' }
				},
				{
					key: 't',
					name: '提申请',
					list: [
						{ iconPath: '/static/t0.png', iconName: '请假', url: '' },
						{ iconPath: '/static/t5.png', iconName: '加班', url: '/pages/home/index' },
						{ iconPath: '/static/t1.png', iconName: '打卡', url: '/pages/project/index' },
						{ iconPath: '/static/t2.png', iconName: '保修', url: '' },
						{ iconPath: '/static/t3.png', iconName: '疫情上报', url: '' },
						{ iconPath: '/static/t4.png', iconName: '换班', url: '' }
					]
				},
				{
					key: 'b',
					name: '看报表',
					list: [{ iconPath: '/static/b0.png', iconName: '考勤日报', url: '' }, { iconPath: '/static/b1.svg', iconName: '巡检报表', url: '' }]
				}
			],
			indicatorDots: true,
			autoplay: true,
			interval: 2000,
			duration: 500
		};
	},
	onLoad() {
		this.GetNoticeList();
	},
	methods: {
		GetNoticeList() {
			this.GET('NT/PageShow', {
				PersonInfo: this.changeData()
			}).then(result => {
				this.notice.list = [];
				result.data.forEach(e => {
					this.notice.list.push({ name: e.NoticeType, key: { guid: e.ProcessID, id: e.Id } });
				});
			});
		}
	}
};
</script>
<style lang="scss">
page {
	background: #eeeeee;
}
.uni-padding-wrap {
	width: 750upx;
	padding: 0upx;
}
.image-index {
	width: 100%;
	height: 100%;
}
.contents {
	width: 96%;
	margin: auto;
}
</style>
